package com.boot.down.controller;

import com.boot.down.entity.GradeData;
import com.boot.down.service.ICounter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/hit")
public class CountController {

	@Autowired
	private ICounter iCounter;

	@GetMapping("/count")
	public int hitCount() {
		iCounter.hit();
		return 0;
	}

	@GetMapping("/get")
	public GradeData get() {
		return iCounter.gaveData();
	}
}
